package cn.tedu.plus.bigint_bigdecimal;

import java.math.BigInteger;

public class BigIntegerDemo {
    public static void main(String[] args) {
        String value1 = "999999999999999999999999888888888888888888877777777775444444444";
        String value2 = "994444444445555552229999888888888888888888877777777775441112232";

        BigInteger number1 = new BigInteger(value1);
        System.out.println(number1);
        BigInteger number2 = new BigInteger(value2);
        System.out.println(number2);

        BigInteger result1 = number1.add(number2);
        System.out.println(result1);

        BigInteger result2 = number1.subtract(number2);
        System.out.println(result2);

        BigInteger result3 = number1.multiply(number2);
        System.out.println(result3);

        BigInteger result4 = number1.divide(number2);
        System.out.println(result4);

        BigInteger[] result5 = number1.divideAndRemainder(number2);
        System.out.println(result5[0]);
        System.out.println(result5[1]);

    }
}
